<?php  
Yii::app()->clientScript->registerScript('search', "  
$('body').on('change','#input_type',function(){
    var _this = this;
    $.ajax({
        type: \"POST\",
        url: '?r=activity/getInput',
        data: 'input_type='+ _this.value,
        cache: false,
        success: function (data) {
            var select=$(_this).nextAll('select'); 
            $(select[0]).html(data);
        }
    });
});");

?> 
<div class='control-group'>
    <label class="control-label required" for="InputForm_input"> 
    输入
    <span class="required">*</span>
    </label>
    <div class="controls">
    <?php echo CHtml::activeDropDownList($model, 'depend_type', DependType::$names, array(
        'id' => 'depend_type[]',
        'name' => 'depend_type[]', 
        'class'=>'input-mini')); ?>
    <?php echo CHtml::activeDropDownList($model, 'input_type', ResourceType::$names, array(
        'id' => 'input_type',
        'name'=> 'input_type[]', 
        'class'=>'input-small',
        /*'ajax' => array(
            'type'=>'POST',
            'url'=>array('getInput'), 
            'success'=>'js: function(data) {var select=$(input_type).nextAll("select"); $(select[0]).html(data); }', 
        ),*/
    )); ?>
    <?php echo CHtml::activeDropDownList($model, 'res_id', Resource::listItems($model->input_type), array(
        'id'=> 'res_id',
        'name'=> 'res_id[]', 
        'class'=>'input-medium')); ?>
    <?php echo CHtml::activeTextField($model, 'partition', array(
        'id'=> 'partition[]',
        'name'=> 'partition[]', 
        'class'=>'input-small')); ?>
    <?php echo CHtml::activeTextField($model, 'log_pattern', array(
        'id'=> 'log_pattern[]',
        'placeholder'=>'路径匹配规则',
        'name'=> 'log_pattern[]', 
        'class'=>'input-medium')); ?>
    </div>
</div>
